import { defHttp } from '/@/utils/http/axios';

enum Api {
  rolelist = '/basic-api/rolelist',
  menuslist = '/basic-api/authority/menulist',
  menusadd = '/basic-api/authority/addmenu',
  menusdelete = '/basic-api/authority/menudel',
  operation_log = '/basic-api/operation_log',
  error_log = '/basic-api/error_log',
}

/**
 * @description: user login api
 */
// 角色列表
export function GetRoleListApi(params) {
  // const data: any = {};
  return defHttp.get({
    url: Api.rolelist,
    params,
  });
}
// 菜单列表
export function GetMenusListApi(params) {
  // const data: any = {};
  return defHttp.get({
    url: Api.menuslist,
    params,
  });
}
// 新增菜单
export function addMenusApi(params) {
  // const data: any = {};
  return defHttp.post({
    url: Api.menusadd,
    params,
  });
}
// 删除菜单
export function delMenusApi(params) {
  // const data: any = {};
  return defHttp.post({
    url: Api.menusdelete,
    params,
  });
}

// 操作日志
export function operationApi(params) {
  // const data: any = {};
  return defHttp.get({
    url: Api.operation_log,
    params,
  });
}

// 错误日志
export function errorApi(params) {
  // const data: any = {};
  return defHttp.get({
    url: Api.error_log,
    params,
  });
}
